<?php
class Admin_IndexController extends Zend_Controller_Action
{
    public function indexAction ()
    {
        Zend_Loader::loadClass("AuthModel");
        Zend_Loader::loadClass("LogModel");
        Zend_Loader::loadClass("LogLine");
        
        
    	//set layout
        $layoutPath = APPLICATION_PATH . '/templates/admin/admin';
        $option = array('layout' => 'index', 'layoutPath' => $layoutPath);
        Zend_Layout::startMvc($option);
        
        $auth = new AuthModel();
        Zend_Debug::dump($auth->getUserInfo('name'));
        
        //create log model for write log
        $logModel = new LogModel();
        $log_line = $logModel->getLogLine();
        
        $log_line->setType(LogLine::TYPE_OPERATION);
        $log_line->addParts("test 123");
        $log_line->addParts("222");
        $log_line->setTime();
        $logModel->addLogLine($log_line);
        
        $log_line->setType(LogLine::TYPE_ERROR);
        $log_line->addParts("test 123");
        $log_line->addParts("222");
        $log_line->setTime();
        $logModel->addLogLine($log_line);
        
        $logModel->flush();
    }
}